# 2025-02-23 some integrals relating to Bessel polynomials.
notes: [[0-journal/---files/2025-02-25 some contour integrals.pdf|2025-02-25 some contour integrals]]
This morning I decided to work out integrals of the form $$
\int_{0}^{\infty} \frac{\cos(x)}{(x^{2}+1)^{n}} dx.
$$It is not particularly "hard", just involves contour integrals with an upper semi-circle contour and finding residues correctly, we can obtain $$
\int_{0}^{\infty} \frac{\cos(x)}{(x^{2}+1)^{n}} dx= \frac{\pi}{2^{n}e} \frac{1}{(n-1)!}\sum_{k=0}^{n-1} {n-1 \choose k} \frac{n^{\underline{k}}}{2^{k}}
$$where $$
n^{\underline k} :=n(n+1)(n+2)\cdots(n+k-1)
$$is the rising factorial of $k$ terms. Then I decided to look into that summation term.
> As it turns out, this is also for $n \ge 1$ $$
\int_{0}^{\infty} \frac{\cos(x)}{(x^{2}+1)^{n}} dx = \frac{\pi}{e} \frac{1}{2^{n}(n-1)!}B_{n-1},
$$with $$
B_{0} = 1, B_{1} = 2, B_{n} = (2n-1)B_{n-1}+B_{n-2}.
$$
And similarly, we have
>For $n \ge 1$, $$
\int_{0}^{\infty} \frac{x \sin(x)}{(x^{2}+1)^{n}}dx = \frac{\pi}{e} \frac{1}{2^{n}(n-1)!}B_{n-2}
$$ with $$
B_{-1} = 1, B_{0} = 1, B_{n}=(2n-1)B_{n-1} + B_{n-2}
$$
Curiously, $$
\int_{0}^{\infty} \frac{\cos(x)}{x^{4}+1} dx = \frac{\pi}{2 e^{1 / \sqrt{2}}}\sin\left( \frac{1}{\sqrt{2}} + \frac{\pi}{4} \right).
$$
If we calculate this sum $$
\sum_{k=0}^{n-1} {n-1 \choose k} \frac{n^{\underline{k}}}{2^{k}}
$$for a few values of $n$, we get the sequence $$
2, 7, 37, 266,\ldots
$$which from OEIS reveals these are the Bessel polynomials $y_{n}(x)$ evaluated at $x=1$, in particular $$
y_{n-1} (1) = \sum_{k=0}^{n-1} {n-1 \choose k} \frac{n^{\underline{k}}}{2^{k}}
$$where $y_{n}(x)$ satisfies the recurrence $$
y_{0}(x) = 1, y_{1}(x) = 1+x, y_{n}(x) = (2n-1)x y_{n-1}(x) + y_{n-2}(x).
$$If we denote $B_{n} = y_{n}(1)$, then the $B_{n}$ satisfies $$
B_{0} = 1, B_{1} = 2, B_{n} = (2n-1)B_{n-1}+B_{n-2},
$$and $$
\int_{0}^{\infty} \frac{\cos(x)}{(x^{2}+1)^{n}} dx = \frac{\pi}{2^{n}e} \frac{1}{(n-1)!}B_{n-1},
$$with $(B_{0},B_{1},B_{2},\ldots) = (1,2,7,37,266,2431,27007,\ldots)$.
These $(B_{n})$ numbers also counts the following: $B_{n}$ is the number of ways to partition the numbers $\{1,\ldots,k\}$ into $n$ groups, where each group has exactly 1 or 2 many elements, for all $k$ where $n\le k \le 2n$.
I should write out the bijection there.